/**
 * Copyright (C)  Gadglet .
 *
 * This file is part of Gadglet
 *
 * Gadglet is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Gadglet is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with Gadglet. If not, see <http://www.gnu.org/licenses/>.
 */
package com.gadglet.core;

import com.gadglet.params.ReqErrorTypes;

/**
 * Gadglet basic Exception 
 *
 */
public class RequestException extends Exception {
	

	private static final long serialVersionUID = 1234566777567L;
	
	private ReqErrorTypes errorType = null;
	private String customError = null;
	
	public RequestException(ReqErrorTypes errorType){
		
		super(errorType.getErrorMessage());
		this.errorType = errorType;
	}
	
	public RequestException(String  customError){
		super(customError);
		this.customError =customError;
	}
	
	
	void setErrorType(ReqErrorTypes errorType) {
		this.errorType = errorType;
	}
	
	public ReqErrorTypes getErrorType(){
		
		return this.errorType;
	}
	
	public String getCustomError() {
		return customError;
	}

	public void setCustomError(String customError) {
		this.customError =  customError;
	}

}
